#include <QtGui/QGuiApplication>
#include <QGuiApplication>
#include <QQuickView>
#include <QQmlContext>

#include <qqml.h>
#include "sqlquerymodel.h"
//#include "qtquick2applicationviewer.h"
#include "imageprovie.h"
#include "database.h"
#include "timer.h"
int main(int argc, char *argv[])
{

    QGuiApplication app(argc, argv);


    QQuickView *viewer=new QQuickView();
    viewer->engine()->addImageProvider(QLatin1String("a"), new imageProvie());
    qmlRegisterType<Timer>( "CustomComponents", 1, 0, "Timer" );
    //qmlRegisterType<DataBaseProvider>( "CustomComponents", 1, 0, "Databaseprovider" );
   // viewer->engine()->setOfflineStoragePath();
    viewer->setSource( QStringLiteral("qml/testQQimage/main.qml"));
    //viewer->setSource( QStringLiteral("qml/testQQimage/Login.qml"));
    viewer->show();
    //connect((QObject*)viewer->engine(),SIGNAL(quit()),app,SLOT(quit()));
    //QtQuick2ApplicationViewer viewer;
    //interface = viewer->rootObject();
   // interface->setProperty("lastpicture7","image://provider/blue.png");
   // viewer(QStringLiteral("qml/testQQimage/main.qml"));
    QObject::connect((QObject*)viewer->engine(),SIGNAL(quit()),&app,SLOT(quit()));
    return app.exec();
}
